<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <!-- Piwik -->
    <script type="text/javascript">
        var _paq = _paq || [];
        /* tracker methods like "setCustomDimension" should be called before "trackPageView" */
        _paq.push(['trackPageView']);
        _paq.push(['enableLinkTracking']);
        (function() {
            var u="//localhost:82/piwik/";
            _paq.push(['setTrackerUrl', u+'piwik.php']);
            _paq.push(['setSiteId', '1']);
            var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
            g.type='text/javascript'; g.async=true; g.defer=true; g.src=u+'piwik.js'; s.parentNode.insertBefore(g,s);
        })();

        function checkLeave(){  
            event.returnValue="确定离开当前页面吗？";  
        }
    </script>
</head>
<body onbeforeunload="checkLeave()">
    测试piwik统计
    <button onclick="_paq.push(['trackEvent', '首页', 'click', '分享', 10]);">点击事件统计</button>

    <a href="http://molian.oschina.io/study_test/test.html">跳转molian域名下的页面</a>

    <a href="http://www.baidu.com">跳转百度页面</a>

    <a href="http://xiaailin.oschina.io/test/testSS.html">跳转当前域名页面</a>

</body>
</html>